function grad = compute_gradient(H, W, ant_positions, user_pos, m, lambda)
    % 计算第 m 个子阵列位置的梯度
    dH = (H(:, m)' * W) - W(:, m);
    grad = real(dH' * (user_pos - ant_positions(m, :)) / lambda);
end
